<h1 class="cm-login-title">Login to the CASH Family.</h1>

{{#error_message}}<div class="cm-error">{{error_message}}</div>{{/error_message}}
<form class="cm-subscription-login" action="" id="cash_{{element_type}}_form_{{element_id}}" method="post">
    <input type="text" class="cm-subcription-email" name="email" placeholder="email" value="{{email_address}}">
    <input type="password" class="cm-subcription-password" name="password" placeholder="password">
    <input type="hidden" name="state" value="validate_login">
    <input type="hidden" name="element_id" value="{{element_id}}">
    {{#all_plans}}
        <input type="hidden" name="plans[]" value="{{plan_id}}" />
    {{/all_plans}}

    <button class="cm-login-submit">Login</button>
    <a href="#" class="cm-secondary-link forgot-password">Forgot password</a>
</form>

<script type="text/javascript">

    var cm = window.cashmusic;
    cm.events.add(cm,'ready', function(e) {
        cm.session.start();
        var forgot_password = document.querySelector('.forgot-password');

        if (forgot_password) {
            cm.events.add(forgot_password, 'click', function (e) {
                e.preventDefault();
                cm.overlay.reveal({"element":"{{element_id}}","endpoint":"{{public_url}}","state":"forgot_password"});
            });
        }

    });

</script>


